package com.xinling.modules.blog.mapper;

import com.xinling.modules.blog.model.entity.BlogPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface BlogPostMapper {
    
    List<BlogPost> selectAll();
    
    BlogPost selectById(@Param("id") Integer id);
    
    List<BlogPost> selectByCategory(@Param("categoryId") Integer categoryId);
    
    List<BlogPost> selectByAuthor(@Param("authorId") Integer authorId);
    
    List<BlogPost> selectByTag(@Param("tagId") Integer tagId);
    
    List<BlogPost> searchByKeyword(@Param("keyword") String keyword);
    
    int insert(BlogPost post);
    
    int updateById(BlogPost post);
    
    int deleteById(@Param("id") Integer id);
    
    int incrementViewCount(@Param("id") Integer id);
    
    int incrementLikeCount(@Param("id") Integer id);
} 